package com.songlanyun.modules.shop.controller.api;

import com.songlanyun.common.annotation.RepeatSubmit;
import com.songlanyun.common.annotation.SysLog;
import com.songlanyun.common.exception.RRException;
import com.songlanyun.common.utils.Constant;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.common.validator.ValidatorUtils;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.applyareaagent.service.ApplyAreaAgentService;
import com.songlanyun.modules.exception.ShopException;
import com.songlanyun.modules.shop.entity.ShopUpdateRecordEntity;
import com.songlanyun.modules.shop.model.dto.ShopApplyDTO;
import com.songlanyun.modules.shop.model.dto.ShopDTO;
import com.songlanyun.modules.shop.model.dto.ShopUpdateRecordDTO;
import com.songlanyun.modules.shop.service.ShopUpdateRecordService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;


/**
 * 商家修改商家信息申请记录表
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2021-02-02 14:05:41
 */
@RestController
@RequestMapping("api/shop/update/record")
public class ShopUpdateRecordApiController extends AbstractApiController {
    @Autowired
    private ShopUpdateRecordService shopUpdateRecordService;

    /**
     * 商家修改商家信息申请
     */
    @RepeatSubmit("3")
    @PostMapping("/apply")
    public R save(@RequestBody ShopUpdateRecordDTO dto) {
        ValidatorUtils.validateEntity(dto);
        shopUpdateRecordService.saveRecord(dto, getShopByUserId(getUserId(true), true,true));

        return R.ok();
    }

}
